import Base from './base'
import Component from './component'
import MainJumpInfo from './component/mainJumpInfo';
import Brand from './component/brand';
import Market from './market';

class LoadPage extends Base {
  brand_type: InstanceType<typeof Brand>['brand_type'] = undefined;
  type = 'PAGE_TYPE_WECHAT_MINI_PROGRAM'
  override_canvas_head_option = ""
  url = ''
  id = ''
  // 原生页
  page_id = ''
  // wechat_channels_live_reserve_id
  // wechat_channels_live_reserve_id = ''
  query() {
    const page_type = this.type;
    let page_spec = {};
    // 视频号直播
    if (page_type == 'PAGE_TYPE_WECHAT_CHANNELS_WATCH_LIVE') {
      page_spec = {

      }
    }


    if (page_type == 'PAGE_TYPE_WECHAT_CANVAS') {
      page_spec = {
        wechat_canvas_spec: {
          override_canvas_head_option: this.override_canvas_head_option,
          page_id: this.page_id
        }
      }
    }
    if (page_type == 'PAGE_TYPE_WECHAT_MINI_PROGRAM') {
      page_spec = {
        wechat_mini_program_spec: {
          mini_program_id: this.id,
          mini_program_path: this.url
        }
      }
    }
    return {
      page_type,
      page_spec
    }

  }

  constructor(options: any) {
    super();
    this.init(options);
    return this;
  }
}

export default LoadPage
